//
//  AlertNoCarTool.m
//  BalanceCar
//
//  Created by 郑信鸿 on 17/6/28.
//  Copyright © 2017年 郑信鸿. All rights reserved.
//

#import "AlertNoCarTool.h"

@interface AlertNoCarTool ()<TipViewDelegate>

@property(nonatomic, strong)NoCarTipView *tipView;
@property(nonatomic, strong)TipSuperView *tipSuperView;

@end

@implementation AlertNoCarTool

- (instancetype)initWithTouchBlock:(TouchBtnBlock)touchBlock{
    
    if (self = [super init]) {
        
        self.touchBlock = touchBlock;
        [self configeSubItems];
    }
    return self;
}


- (void)configeSubItems{
    
    self.tipView = [[NoCarTipView alloc] init];
    self.tipView.delegate = self;
    CGFloat verticalY = kUIScreenHeight - 20 - self.tipView.tip_height;
    self.tipSuperView = [TipSuperView tipSuperViewWithTipView:self.tipView verticalY:verticalY];
    
    
}

- (void)showView{
    
    [self.tipSuperView showInView];
    
}

- (void)tipViewWillHideWithTipView:(BaseTipView *)tipView{

    [self.tipSuperView hideView];
    if (self.touchBlock) {
         self.touchBlock(nil);
    }
}


@end
